3.981 \(\int (1-x)^n (1+x)^{-n} \, dx\)

Optimal. Leaf size=38 \[ -\frac {2^{-n} (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac {1-x}{2}\right )}{n+1} \]

[Out]

-(1-x)^(1+n)*hypergeom([n, 1+n],[2+n],1/2-1/2*x)/(2^n)/(1+n)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {69} \[ -\frac {2^{-n} (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac {1-x}{2}\right )}{n+1} \]

Antiderivative was successfully verified.

[In]

Int[(1 - x)^n/(1 + x)^n,x]

[Out]

-(((1 - x)^(1 + n)*Hypergeometric2F1[n, 1 + n, 2 + n, (1 - x)/2])/(2^n*(1 + n)))

Rule 69

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*Hypergeometric2F1[
-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b*(m + 1)*(b/(b*c - a*d))^n), x] /; FreeQ[{a, b, c, d, m, n}
, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] ||  !(Ra
tionalQ[n] && GtQ[-(d/(b*c - a*d)), 0]))

Rubi steps

\begin {align*} \int (1-x)^n (1+x)^{-n} \, dx &=-\frac {2^{-n} (1-x)^{1+n} \, _2F_1\left (n,1+n;2+n;\frac {1-x}{2}\right )}{1+n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 38, normalized size = 1.00 \[ -\frac {2^{-n} (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac {1-x}{2}\right )}{n+1} \]

Antiderivative was successfully verified.

[In]

Integrate[(1 - x)^n/(1 + x)^n,x]

[Out]

-(((1 - x)^(1 + n)*Hypergeometric2F1[n, 1 + n, 2 + n, (1 - x)/2])/(2^n*(1 + n)))

________________________________________________________________________________________

fricas [F]  time = 0.93, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)^n/((1+x)^n),x, algorithm="fricas")

[Out]

integral((-x + 1)^n/(x + 1)^n, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)^n/((1+x)^n),x, algorithm="giac")

[Out]

integrate((-x + 1)^n/(x + 1)^n, x)

________________________________________________________________________________________

maple [F]  time = 0.14, size = 0, normalized size = 0.00 \[ \int \left (-x +1\right )^{n} \left (x +1\right )^{-n}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x+1)^n/((x+1)^n),x)

[Out]

int((-x+1)^n/((x+1)^n),x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)^n/((1+x)^n),x, algorithm="maxima")

[Out]

integrate((-x + 1)^n/(x + 1)^n, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.03 \[ \int \frac {{\left (1-x\right )}^n}{{\left (x+1\right )}^n} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1 - x)^n/(x + 1)^n,x)

[Out]

int((1 - x)^n/(x + 1)^n, x)

________________________________________________________________________________________

sympy [C]  time = 17.88, size = 42, normalized size = 1.11 \[ \frac {2^{- n} \left (x - 1\right ) \left (x - 1\right )^{n} e^{i \pi n} \Gamma \left (n + 1\right ) {{}_{2}F_{1}\left (\begin {matrix} n, n + 1 \\ n + 2 \end {matrix}\middle | {\frac {\left (x - 1\right ) e^{i \pi }}{2}} \right )}}{\Gamma \left (n + 2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)**n/((1+x)**n),x)

[Out]

2**(-n)*(x - 1)*(x - 1)**n*exp(I*pi*n)*gamma(n + 1)*hyper((n, n + 1), (n + 2,), (x - 1)*exp_polar(I*pi)/2)/gam
ma(n + 2)

________________________________________________________________________________________